package com.xiaomi.service.impl;

import com.xiaomi.entity.Order;
import com.xiaomi.mapper.OrderMapper;
import com.xiaomi.service.OrderSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName OrderServiceImpl
 * @Description TODO
 * @Author WL
 * @Date 2021/11/28 21:00
 * @Version 1.0
 **/
@Service
public class OrderServiceImpl implements OrderSevice {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> selectType(Integer did) {
        return orderMapper.selectType(did);
    }

/*    @Override
    public Integer getCount(String name) throws Exception {
        return orderMapper.getCount(name);
    }*/

    @Override
    public void insert(String name, String iamg, Integer quantity,
                       String guige, BigDecimal price, String purchase,
                       String address, Integer sku_id) throws Exception {
        orderMapper.insert(name, iamg, quantity, guige, price, purchase, address, sku_id);
    }

    @Override
    public void delete(Integer id) throws Exception {
        orderMapper.delete(id);
    }
}
